/**
  * This is run after the the web page has been rendered.
  * $(document).ready documented here:
  * http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
  */
$(document).ready(function() {
  try {
    /* This connects sampleQObjects signal to our slot */
    communication.signal.connect(slot);
    /* This calls a slot which then in turn emits the signal. */
    communication.slotThatEmitsSignal();
  }
  catch(e) {
    alert(e);
  }
});
 
function slot(object) {
  var objectString = object.sender + 
                     " has emited signal " + 
                     object.signalsEmited + 
                     " times.";
  alert(objectString);
}